﻿/*
 *  This file is part of Worker Time.
 *
 *  Worker Time is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  Worker Time is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Worker Time.  If not, see <http://www.gnu.org/licenses/>.
 */
using System;
using System.ComponentModel;
using System.Data.Common;
using System.Drawing;
using System.IO;
using System.Reflection;
using System.Threading;
using System.Windows.Forms;
using WorkerTime.Database;
using WorkerTime.Utils;
using System.Data.SQLite;
using System.Data;
using HTMLReportEngine;
using System.Globalization;

namespace WorkerTime
{
    public partial class formWorkerTime : Form
    {
        private Track activedTrack;
        private Manager database;
        private Boolean open;
        private IniFile configuration;
        private Boolean inTray;
        private ComponentResourceManager localization;
        
        public formWorkerTime()
        {
            configuration = new IniFile(Path.Combine(Environment.CurrentDirectory, @"config.ini"));
            localization = new System.ComponentModel.ComponentResourceManager(typeof(WorkerTimeStrings));
            ChangeLanguage();            
            open = false;
            inTray = false;
            InitializeComponent();
        }

        #region Assembly Attribute Accessors

        public string AssemblyTitle
        {
            get
            {
                object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
                if (attributes.Length > 0)
                {
                    AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0];
                    if (titleAttribute.Title != "")
                    {
                        return titleAttribute.Title;
                    }
                }
                return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
            }
        }

        public string AssemblyVersion
        {
            get
            {
                return Assembly.GetExecutingAssembly().GetName().Version.ToString();
            }
        }

        public string AssemblyDescription
        {
            get
            {
                object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
                if (attributes.Length == 0)
                {
                    return "";
                }
                return ((AssemblyDescriptionAttribute)attributes[0]).Description;
            }
        }

        public string AssemblyProduct
        {
            get
            {
                object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
                if (attributes.Length == 0)
                {
                    return "";
                }
                return ((AssemblyProductAttribute)attributes[0]).Product;
            }
        }

        public string AssemblyCopyright
        {
            get
            {
                object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
                if (attributes.Length == 0)
                {
                    return "";
                }
                return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
            }
        }

        public string AssemblyCompany
        {
            get
            {
                object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
                if (attributes.Length == 0)
                {
                    return "";
                }
                return ((AssemblyCompanyAttribute)attributes[0]).Company;
            }
        }
        #endregion

        public Track ActivedTrack
        {
            get
            {
                return activedTrack;
            }
            set
            {
                activedTrack = value;
            }
        }

        private void formWorkerTime_Load(object sender, EventArgs e)
        {
            this.notifyIcon.Text = AssemblyTitle + " " + localization.GetString("String1") + " " + AssemblyVersion;
            ChangeLanguage();
            
            String fileName = configuration.IniReadValue("Geral", "LastDatabase");
            if (fileName.Length == 0 && !File.Exists("Workertime.db3"))
            {
                InputBoxResult result = InputBox.Show(localization.GetString("String2"),localization.GetString("String3"),"WorkerTime.db3");
                if (result.OK)
                {
                    database = new Manager(result.Text);
                    UpdateFormTitle(result.Text);
                    configuration.IniWriteValue("Geral", "LastDatabase", result.Text);
                }
                else
                {
                    this.Dispose();
                    return;
                }
            }
            else
            {
                if (fileName.Length == 0)
                    fileName = "WorkerTime.db3";
                database = new Manager(fileName);
                UpdateFormTitle(fileName);
            }
            CloseMiniReport();
            TrackUtils.PopulateComboBoxProjects(database, comboBoxProject);
            buttonEnd.Enabled = false;
        }

        private void buttonStart_Click(object sender, EventArgs e)
        {
            StartTrack();
            
        }

        private void StartTrack()
        {
            if (VerifyNewItens())
            {
                // Arruma o tray
                if (inTray)
                    ChangeTrayIcon(1);
                this.notifyIcon.Text = ((ComboListItem)comboBoxProject.Items[comboBoxProject.SelectedIndex]).LongName + " : " + ((ComboListItem)comboBoxActivity.Items[comboBoxActivity.SelectedIndex]).LongName;

                // Zera a track e o contador
                this.activedTrack = null;
                RestartTimer();

                // Cria a nova track
                Track actualTrack = new Track(Int32.Parse(((ComboListItem)comboBoxProject.Items[comboBoxProject.SelectedIndex]).ShortName), Int32.Parse(((ComboListItem)comboBoxActivity.Items[comboBoxActivity.SelectedIndex]).ShortName));
                this.activedTrack = actualTrack;
                this.activedTrack.Start();

                // Configura ui
                this.timer.Enabled = true;
                this.buttonStart.Enabled = false;
                this.buttonEnd.Enabled = true;                
            }
        }

        private bool VerifyNewItens()
        {
            if (comboBoxProject.SelectedIndex == -1 && comboBoxActivity.SelectedIndex == -1 && comboBoxProject.Text.Length > 0 && comboBoxActivity.Text.Length > 0)
            {
                if (inTray)
                    GetOutOfTray();
                if (MessageBox.Show(String.Format(localization.GetString("String4"), comboBoxProject.Text, comboBoxActivity.Text), localization.GetString("String3"), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    database.ExecuteNonQuery("INSERT INTO Projects (Name) VALUES ('" + comboBoxProject.Text + "')");
                    String projectId = database.GetProjectId(comboBoxProject.Text);
                    database.ExecuteNonQuery("INSERT INTO Activity (Name,ProjectID) VALUES ('" + comboBoxActivity.Text + "'," + projectId + ")");
                    String activityId = database.GetActivityId(comboBoxActivity.Text);
                    TrackUtils.PopulateComboBoxProjects(database, comboBoxProject, projectId);
                    TrackUtils.PopulateComboBoxActivities(database, comboBoxProject, comboBoxActivity, activityId);
                }
                else
                {
                    return false;
                }
            }
            else if (comboBoxProject.SelectedIndex >= 0 && comboBoxActivity.SelectedIndex == -1 && comboBoxActivity.Text.Length > 0)
            {
                if (inTray)
                    GetOutOfTray();
                if (MessageBox.Show(String.Format(localization.GetString("String5"), comboBoxActivity.Text, comboBoxProject.Text), localization.GetString("String3"), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    String projectId = ((ComboListItem)comboBoxProject.Items[comboBoxProject.SelectedIndex]).ShortName;
                    database.ExecuteNonQuery("INSERT INTO Activity (Name,ProjectID) VALUES ('" + comboBoxActivity.Text + "'," + projectId + ")");
                    String activityId = database.GetActivityId(comboBoxActivity.Text);
                    TrackUtils.PopulateComboBoxActivities(database, comboBoxProject, comboBoxActivity,activityId);
                }
                else
                {
                    return false;
                }
            }
            else if (comboBoxProject.SelectedIndex == -1 && comboBoxActivity.SelectedIndex == -1)
            {
                if (inTray)
                    GetOutOfTray();
                MessageBox.Show(localization.GetString("String6"), localization.GetString("String3"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                return false;
            }
            else if (comboBoxProject.SelectedIndex == -1 && comboBoxActivity.SelectedIndex != -1 || comboBoxActivity.Text.Length == 0)
            {
                if (inTray)
                    GetOutOfTray();
                MessageBox.Show(localization.GetString("String7"), localization.GetString("String3"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                return false;
            }
            return true;
        }

        private void buttonEnd_Click(object sender, EventArgs e)
        {
            EndTrack();
        }

        private void EndTrack()
        {
            // Para a track atual
            this.activedTrack.Stop();
            this.activedTrack.Save(database);

            // Zera a track e o contador
            this.timer.Enabled = false;
            this.activedTrack = null;

            // Arruma o tray
            if (inTray)
                ChangeTrayIcon(2);
                
            this.notifyIcon.Text = AssemblyTitle + " " + localization.GetString("String1") + " " + AssemblyVersion;

            // Configura ui
            this.buttonStart.Enabled = true;
            this.buttonEnd.Enabled = false;

            // Atualiza mini report
            UpdateMiniReport();
        }

        private void ChangeTrayIcon(int option)
        {
            if (option == 2)
                this.notifyIcon.Icon = Icon.FromHandle(global::WorkerTime.Properties.Resources.control_play.GetHicon());
            else if (option == 1)
                this.notifyIcon.Icon = Icon.FromHandle(global::WorkerTime.Properties.Resources.control_stop.GetHicon());
            else if (option == 3)
            {
                System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(formWorkerTime));
                resources.ApplyResources(this.notifyIcon, "notifyIcon");
            }
        }

        private void timer_Tick(object sender, EventArgs e)
        {
            if (activedTrack != null)
            {
                DateTime formattedTotal = DateTime.MinValue.Add(this.activedTrack.ElapsedTime());
                labelTimer.Text = String.Format(formattedTotal.ToString("HH:mm:ss"));
                this.notifyIcon.Text = ((ComboListItem)comboBoxProject.Items[comboBoxProject.SelectedIndex]).LongName + " : " + ((ComboListItem)comboBoxActivity.Items[comboBoxActivity.SelectedIndex]).LongName + " : " + String.Format(formattedTotal.ToString("HH:mm:ss")); ;
            }
        }

        private void RestartTimer() 
        {
            labelTimer.Text = "00:00:00";
        }

        private void comboBoxProject_SelectedIndexChanged(object sender, EventArgs e)
        {
            TrackUtils.PopulateComboBoxActivities(database,comboBoxProject, comboBoxActivity);
            UpdateMiniReport();
        }

        private void sairToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void EndProgram()
        {
            if (activedTrack != null)
            {
                activedTrack.Stop();
                activedTrack.Save(database);
            }
            if (database != null)
                database.Close();
        }

        private void buttonMiniReport_Click(object sender, EventArgs e)
        {
            if (!open)
                OpenMiniReport();
            else
                CloseMiniReport();
            UpdateMiniReport();
        }

        private void UpdateMiniReport()
        {
            if (open)
            {
                //DateTime formattedTotal = DateTime.MinValue.Add(database.GetDaysTotal());
                labelDaysTotalValue.Text = String.Format(new DurationFormatProvider(), "{0}", database.GetDaysTotal());
                    // String.Format(formattedTotal.ToString("HH:mm:ss"));
                if (comboBoxProject.SelectedIndex >= 0)
                {
                    //formattedTotal = DateTime.MinValue.Add(database.GetProjectsTotal(((ComboListItem)comboBoxProject.Items[comboBoxProject.SelectedIndex]).ShortName));
                    labelProjectsTotalValue.Text = String.Format(new DurationFormatProvider(), "{0}",database.GetProjectsTotal(((ComboListItem)comboBoxProject.Items[comboBoxProject.SelectedIndex]).ShortName));
                    //String.Format(formattedTotal.ToString("HH:mm:ss"));
                }
                if (comboBoxActivity.SelectedIndex >= 0)
                {
                    //formattedTotal = DateTime.MinValue.Add(database.GetActivitysTotal(((ComboListItem)comboBoxActivity.Items[comboBoxActivity.SelectedIndex]).ShortName));
                    labelActivitysTotalValue.Text = String.Format(new DurationFormatProvider(), "{0}", database.GetActivitysTotal(((ComboListItem)comboBoxActivity.Items[comboBoxActivity.SelectedIndex]).ShortName));
                        //String.Format(formattedTotal.ToString("HH:mm:ss"));
                }
            }
        }

        private void OpenMiniReport()
        {
            this.Size = new Size(221, 236);
            this.buttonMiniReport.Image = global::WorkerTime.Properties.Resources.bullet_arrow_up;
            this.groupBox1.Visible = true;
            open = true;
        }

        private void CloseMiniReport()
        {
            this.Size = new Size(221, 161);
            this.buttonMiniReport.Image = global::WorkerTime.Properties.Resources.bullet_arrow_down;
            this.groupBox1.Visible = false;
            open = false;
        }

        private void comboBoxActivity_SelectedIndexChanged(object sender, EventArgs e)
        {
            UpdateMiniReport();
        }

        private void sobreToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AboutBox about = new AboutBox();
            about.ShowDialog();
        }

        private void formWorkerTime_FormClosing(object sender, FormClosingEventArgs e)
        {
            EndProgram();
        }

        private void novoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (activedTrack != null)
            {
                EndTrack();
            }
            InputBoxResult result = InputBox.Show(localization.GetString("String2"),localization.GetString("String3"),"WorkerTime.db3");
            if (result.OK) 
            {
                if (File.Exists(result.Text)) {
                    if (MessageBox.Show(localization.GetString("String29"), localization.GetString("String3"), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        database = new Manager(result.Text);
                        UpdateFormTitle(result.Text);
                        configuration.IniWriteValue("Geral", "LastDatabase", result.Text);
                        comboBoxProject.Items.Clear();
                        comboBoxProject.Text = "";
                        comboBoxActivity.Items.Clear();
                        comboBoxActivity.Text = "";
                        TrackUtils.PopulateComboBoxProjects(database, comboBoxProject);
                    }
                }
            }
        }

        private void abrirToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (activedTrack != null)
            {
                EndTrack();
            }
            InputBoxResult result = InputBox.Show(localization.GetString("String8"), localization.GetString("String3"), "WorkerTime.db3");
            if (result.OK) 
            {
                if (File.Exists(result.Text))
                {
                    database = new Manager(result.Text);
                    UpdateFormTitle(result.Text);
                    configuration.IniWriteValue("Geral", "LastDatabase", result.Text);
                    comboBoxProject.Items.Clear();
                    comboBoxProject.Text = "";
                    comboBoxActivity.Items.Clear();
                    comboBoxActivity.Text = "";
                    TrackUtils.PopulateComboBoxProjects(database, comboBoxProject);
                }
                else
                {
                    MessageBox.Show(localization.GetString("String9"), localization.GetString("String3"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        private void UpdateFormTitle(String databaseFilename)
        {
            this.Text = "Worker Time - " + databaseFilename;
        }

        private void GetOutOfTray()
        {
            Show();
            WindowState = FormWindowState.Normal;
            inTray = false;
            ChangeTrayIcon(3);
        }

        private void formWorkerTime_Resize(object sender, EventArgs e)
        {
            if (FormWindowState.Minimized == WindowState)
            {
                PutInTray();                                
            }
        }

        private void PutInTray()
        {
            inTray = true;
            ChangeTrayIcon(activedTrack == null ? 2 : 1);
            if (Properties.Settings.Default.ShowBallon) {
                notifyIcon.ShowBalloonTip(2000, AssemblyTitle, localization.GetString("String30"), ToolTipIcon.Info);
                Properties.Settings.Default.ShowBallon = false;
                Properties.Settings.Default.Save();
            }
            Hide();

        }

        private void notifyIcon_Click(object sender, EventArgs e)
        {
            if (e is MouseEventArgs)
            {
                MouseEventArgs mouseEvent = (MouseEventArgs)e;
                if (mouseEvent.Button == MouseButtons.Left)
                {
                    if (inTray)
                        GetOutOfTray();
                    else
                        PutInTray();
                } else if (mouseEvent.Button == MouseButtons.Right) 
                {
                    if (activedTrack == null)
                    {
                        StartTrack();
                    }
                    else
                    {
                        EndTrack();
                    }
                }
            }

        }

        private void toolStripMenuItemPortuguese_Click(object sender, EventArgs e)
        {
            ChangeLanguage("pt-BR");
            UpdateGUILanguage("pt-BR");
        }

        private void toolStripMenuItemEnglish_Click(object sender, EventArgs e)
        {
            ChangeLanguage("en-US");
            UpdateGUILanguage("en-US");
        }

        private void ChangeLanguage()
        {
            String language = configuration.IniReadValue("Geral", "Language");

            if (language.Length == 0 || language.ToLower().Equals("default") || language.ToLower().Equals("pt-BR"))
            {
                ChangeLanguage("en-US");

            }
            else
            {
                ChangeLanguage(language);
            }
        }

        private void ChangeLanguage(string language)
        {
            Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(language);
            Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(language);
            configuration.IniWriteValue("Geral", "Language", language);
            if (toolStripMenuItemPortuguese != null && toolStripMenuItemEnglish != null)
            {
                toolStripMenuItemEnglish.Checked = false;
                toolStripMenuItemPortuguese.Checked = false;
                if (language == "en-US")
                    toolStripMenuItemEnglish.Checked = true;
                else if (language == "pt-BR")
                    toolStripMenuItemPortuguese.Checked = true;
            }            
        }

        private void buttonReport_Click(object sender, EventArgs e)
        {
            SQLiteConnection connection;
            SQLiteCommand command;
            SQLiteDataAdapter dataAdapter;
            DataSet dataSet;
            SQLiteCommandBuilder commandBuilder;

            // Configura a conexão, dataset, etc.
            connection = new SQLiteConnection("Data source=" + this.database.fileName);
            command = new SQLiteCommand(connection);
            command.CommandText = "SELECT Projects.Name As ProjectName, Activity.Name As ActivityName, Tracks.Start as Start, Tracks.End As End, Tracks.Duration As Duration, Tracks.ProjectID As ProjectID FROM Tracks,Activity,Projects ON Tracks.ProjectID=Projects.ID AND Tracks.ActivityID = Activity.ID";
            dataAdapter = new SQLiteDataAdapter(command);
            dataSet = new DataSet("Table");
            commandBuilder = new SQLiteCommandBuilder(dataAdapter);
            dataAdapter.Fill(dataSet, "Table");

            // Monta o relatório em HTML
            Report report = new Report();
            report.ReportTitle = localization.GetString("String11");
            report.ReportSource = dataSet;

            // Cria sessão para projetos
            Section projectSection = new Section("ProjectName", String.Format("{0}: ",localization.GetString("String12")));
            projectSection.IncludeTotal = true;
            report.Sections.Add(projectSection);

            // Cria sessão para atividades
            Section activitySection = new Section("ActivityName", String.Format("{0}: ", localization.GetString("String13")));
            activitySection.IncludeTotal = true;
            projectSection.SubSection = activitySection;          

            // Itens da sessão
            report.ReportFields.Add(new Field("Start", localization.GetString("String14"), 50, ALIGN.CENTER));
            report.ReportFields.Add(new Field("End", localization.GetString("String15"), 50, ALIGN.CENTER));

            // Duração deve ser configurada como TimeSpan
            Field durationField = new Field("Duration", localization.GetString("String16"), 100, ALIGN.CENTER);
            durationField.isTimeSpan = true;
            durationField.FormatProvider = new DurationFormatProvider();
            report.ReportFields.Add(durationField);

            // Duração total
            report.TotalFields.Add("Duration");
            report.IncludeTotal = true;

            if (File.Exists("Report.htm"))
                File.Delete("Report.htm");

            report.SaveReport("Report.htm");

            if (File.Exists("Report.htm"))
                System.Diagnostics.Process.Start("Report.htm");
            else
                MessageBox.Show(localization.GetString("String17"), localization.GetString("String3"), MessageBoxButtons.OK, MessageBoxIcon.Error);           

        }

        private void buttonMoreProject_Click(object sender, EventArgs e)
        {
            if (VerifyNewItens())
            {
                GenericManagerGUI projectManager = new GenericManagerGUI(this.database, localization.GetString("String12") , "Projects", "Name");
                projectManager.ShowDialog();
                TrackUtils.PopulateComboBoxProjects(database, comboBoxProject);
            }
        }

        private void buttonMoreActivity_Click(object sender, EventArgs e)
        {
            if (VerifyNewItens())
            {
                GenericManagerGUI projectManager = new GenericManagerGUI(this.database, localization.GetString("String13") , "Activity", "Name,ProjectID", ((ComboListItem)comboBoxProject.Items[comboBoxProject.SelectedIndex]).ShortName);
                projectManager.ShowDialog();
                TrackUtils.PopulateComboBoxActivities(database,comboBoxProject, comboBoxActivity);
            }
        }

        private void buttonMoreTracks_Click(object sender, EventArgs e)
        {
            TracksManagerGUI projectManager = new TracksManagerGUI(this.database);
            projectManager.ShowDialog();
        }

        private void UpdateGUILanguage(String lang)
        {            
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(formWorkerTime));
            resources.ApplyResources(this.menuStrip1, "menuStrip1");
            resources.ApplyResources(this.toolStripMenuItemFile, "arquivoToolStripMenuItem");
            resources.ApplyResources(this.toolStripMenuItemNew, "novoToolStripMenuItem");
            resources.ApplyResources(this.toolStripMenuItemOpen, "abrirToolStripMenuItem");
            resources.ApplyResources(this.toolStripSeparator1, "toolStripSeparator1");
            resources.ApplyResources(this.toolStripMenuItemExit, "sairToolStripMenuItem");
            resources.ApplyResources(this.toolStripMenuItemLanguage, "toolStripMenuItem1");
            resources.ApplyResources(this.toolStripMenuItemPortuguese, "toolStripMenuItemPortuguese");
            resources.ApplyResources(this.toolStripMenuItemEnglish, "toolStripMenuItemEnglish");
            resources.ApplyResources(this.toolStripMenuItemAbout, "sobreToolStripMenuItem");
            resources.ApplyResources(this.labelProject, "labelProject");
            resources.ApplyResources(this.labelActivity, "labelActivity");
            resources.ApplyResources(this.comboBoxActivity, "comboBoxActivity");
            resources.ApplyResources(this.comboBoxProject, "comboBoxProject"); 
            resources.ApplyResources(this.labelTimer, "labelTimer");
            resources.ApplyResources(this.groupBox1, "groupBox1");
            resources.ApplyResources(this.labelActivitysTotalValue, "labelActivitysTotalValue");
            resources.ApplyResources(this.labelActivitysTotal, "labelActivitysTotal");
            resources.ApplyResources(this.labelProjectsTotalValue, "labelProjectsTotalValue");
            resources.ApplyResources(this.labelProjectsTotal, "labelProjectsTotal");
            resources.ApplyResources(this.labelDaysTotalValue, "labelDaysTotalValue");
            resources.ApplyResources(this.labelDaysTotal, "labelDaysTotal");
            resources.ApplyResources(this.notifyIcon, "notifyIcon");
            resources.ApplyResources(this.buttonMoreTracks, "buttonMoreTracks");
            resources.ApplyResources(this.buttonMoreActivity, "buttonMoreActivity");
            resources.ApplyResources(this.buttonMoreProject, "buttonMoreProject");
            resources.ApplyResources(this.buttonReport, "buttonReport");
            resources.ApplyResources(this.buttonEnd, "buttonEnd");
            resources.ApplyResources(this.buttonStart, "buttonStart");

        }
    }
}